/**
 * 功能描述 入住回忆处理处理表单
 */
define(function (require, exports, module) {
	var Form = require("form")
    var instance = {
        initComponent: function (widget) {
        	var meetingform = new Form({
        		parentNode:"#checkInMeeting",
        		model:{
        			defaultButton : false,
        			 layout : '3_1',
        			items:[{
        				 name:"pkCheckInMeeting",
 						 type:"hidden"
        			},{
        				name:"version",
						type:"hidden",
						defaultValue:"0"
        			},{
        				name:"haveMeeting",
        				label:"是否会议",
        				type:"radio",
        				"break": true,
        				list:[{
        					key:true,
        					value:"是",
        					isDefault: true
        				},{
        					key:false,
        					value:"否"
        				}],
        				events: {
        					"change": function(e){
        						var haveMeeting=meetingform.getValue("haveMeeting");
        						meetingform.setDisabled("meetingDate",!haveMeeting);
    							meetingform.setDisabled("screenings",!haveMeeting);
    							meetingform.setDisabled("meetingRoom",!haveMeeting);
    							meetingform.setDisabled("peoCount",!haveMeeting);
    							meetingform.setDisabled("meetPlaceType",!haveMeeting);
    							meetingform.setDisabled("content",!haveMeeting);
    							meetingform.setDisabled("contentLED",!haveMeeting);
    							meetingform.setDisabled("license",!haveMeeting);
    							meetingform.setDisabled("description",!haveMeeting);
        						if(!haveMeeting){
        							meetingform.setValue("meetingDate","");
        							meetingform.setValue("screenings","");
        							meetingform.setValue("meetingRoom","");
        							meetingform.setValue("peoCount","");
        							meetingform.setValue("meetPlaceType","");
        							meetingform.setValue("content","");
        							meetingform.setValue("contentLED","");
        							meetingform.setValue("license","");
        							meetingform.setValue("description","");
	        					}
        					}
        				}
        			},{
        				name:"meetingDate",
        				label:"会议时间",
        				type: "date",
        				mode:"YYYY-MM-DD HH:mm",
        				validate:["required"]
        			},{
        				name:"screenings",
        				label:"场次"
        			},{
        				name:"meetingRoom",
        				label:"会议室",
        				validate:["required"]
        			},{
        				name:"peoCount",
        				label:"参会人数",
        				validate:["required"]
        			},{
        				name:"meetPlaceType",
        				label:"会议台型"
        			},{
        				name:"content",
        				label:"例牌横幅",
        				"break": true
        			},{
        				name:"contentLED",
        				label:"前厅LED",
        				"break": true
        			},{
        				name:"license",
        				label:"水牌",
        				"break": true
        			},{
        				name:"description",
        				label:"备注",
        				"break": true,
        				type: "textarea"
        			}]
        		}
        	});
        	 widget.set("meetingform", meetingform);
        }
    };
    module.exports = instance;
});
